<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <title>商家优惠券服务信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="referrer" content="never">
    <meta http-equiv="Pragma"  content="no-cache"/>
     
    <meta http-equiv="Cache-Control"  content="no-cache"/>
     
    <meta http-equiv="Expires"  content="0"/>

    <link rel="stylesheet" href="/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/layui/style/admin.css" media="all"/>
    <style>
        .business_head,.business_con{
            width: 100%;
            height: 32px;
        }
        .business_con{
            margin-bottom: 10px;
        }
        .business_head div{
            float: left;
            width:50%;
            text-align: center;
        }
        .business_week,.business_time{
            float: left;
            width:50%;
            text-align: center;
        }
        .business_time{
            display: flex;
            justify-content: space-between;
        }
        .business_time input{
            height: 26px;
            width: 20%;
            padding: 0 10px;
            margin: 0;
        }
    </style>

</head>

<body>

<form class="layui-form" lay-filter="business_form">
    <div id="business" style="display: none">
        <div class="business_head">
            <div>营业天</div>
            <div>营业时间</div>
        </div>
        <div class="business_con" th:each="time,teimStat:${workTimelist}">
            <input type="hidden"  name="id" th:value="${time.id}"/>
            <input type="hidden"  name="type" th:value="${time.type}"/>
            <div class="business_week">
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='MONDAY'}" title="星期一"/>
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='TUESDAY'}" title="星期二"/>
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='WEDNESDAY'}" title="星期三"/>
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='THURSDAY'}" title="星期四"/>
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='FRIDAY'}" title="星期五"/>
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='SATURDAY'}" title="星期六"/>
                <input type="checkbox" name="business_week" th:checked="${time.status==1}" th:if="${time.type=='SUNDAY'}" title="星期日"/>
            </div>
            <div class="business_time">
                <div>
                    <input name="business_start_hours" lay-verify="required|number|hours" type="text" th:value="${time.begin_hour}" placeholder="开始时"/>
                    <b>:</b>
                    <input name="business_start_minutes" lay-verify="required|number|minutes" type="text" th:value="${time.begin_minute}" placeholder="开始分"/>
                </div>
                <b>-</b>
                <div>
                    <input name="business_end_hours" lay-verify="required|number|hours" type="text" th:value="${time.end_hour}" placeholder="结束时"/>
                    <b>:</b>
                    <input name="business_end_minutes" lay-verify="required|number|minutes" type="text" th:value="${time.end_minute}" placeholder="结束分"/>
                </div>
            </div>
        </div>
        <div style="text-align: right" th:hidden="${cpnServiceInfo.status}==1">
            <button class="layui-btn" lay-submit="" lay-filter="business_form_ok">保存</button>
        </div>
    </div>
</form>

<form class="layui-form" lay-filter="cpn_mach_service_form" action="" style=" width:60%;margin: 0 auto">
    <input type="hidden" id="id" name="id" th:value="${cpnServiceInfo.id}"/>
    <input type="hidden" id="oemId" name="oemId" th:value="${cpnServiceInfo.oemId}"/>
    <input type="hidden" id="userId" name="userId" th:value="${cpnServiceInfo.userId}"/>

    <div class="layui-form-item ">

        <label class="layui-form-label"><span style="color: red">*</span>最低消费(单位/元):</label>
        <div class="layui-input-block">
            <input type="text" name="min_money" lay-verify="required|number|minMoney" th:value="${cpnServiceInfo.min_money}"
                   placeholder="请输入最低消费" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item ">

        <label class="layui-form-label"><span style="color: red">*</span>最高消费(单位/元):</label>
        <div class="layui-input-block">
            <input type="text" name="max_money" lay-verify="required|number|minMoney" th:value="${cpnServiceInfo.max_money}"
                   placeholder="请输入最高消费" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item ">

        <label class="layui-form-label"><span style="color: red">*</span>平均消费(单位/元):</label>
        <div class="layui-input-block">
            <input type="text" name="average_money" lay-verify="required|number|minMoney" th:value="${cpnServiceInfo.average_money}"
                   placeholder="请输入平均消费" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item ">
        <label class="layui-form-label"><span style="color: red">*</span>选择服务费:</label>
        <div class="layui-inline" style="width: 852px">
            <select name="service_fee" lay-verify="" lay-filter="test" id="service_fee">
                <option value="0.1"  th:selected="${cpnServiceInfo.service_fee==0.1}">10%</option>
                <option value="0.15" th:selected="${cpnServiceInfo.service_fee==0.15}">15%</option>
                <option value="0.2"  th:selected="${cpnServiceInfo.service_fee==0.2}">20%</option>
                <option value="0.25" th:selected="${cpnServiceInfo.service_fee==0.25}">25%</option>
                <option value="0.3"  th:selected="${cpnServiceInfo.service_fee==0.3}">30%</option>
            </select>
        </div>

    </div>

    <div class="layui-form-item ">

        <label class="layui-form-label"><span style="color: red">*</span>服务电话:</label>
        <div class="layui-input-block">
            <input type="text" name="service_phone" lay-verify="required" th:value="${cpnServiceInfo.service_phone}"
                   placeholder="请输入服务电话" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商家服务类型:</label>
        <div class="layui-input-block">
            <input type="checkbox" name="business_service" value="BIZ_SERVICE_DELIVER"
                   th:checked="${#strings.contains(cpnServiceInfo.business_service==null?'':cpnServiceInfo.business_service,'BIZ_SERVICE_DELIVER')}"
                   title="外卖服务">
            <input type="checkbox" name="business_service" value="BIZ_SERVICE_FREE_PARK"
                   th:checked="${#strings.contains(cpnServiceInfo.business_service==null?'':cpnServiceInfo.business_service,'BIZ_SERVICE_FREE_PARK')}"
                   title="停车位">
            <input type="checkbox" name="business_service" value="BIZ_SERVICE_WITH_PET"
                   th:checked="${#strings.contains(cpnServiceInfo.business_service==null?'':cpnServiceInfo.business_service,'BIZ_SERVICE_WITH_PET')}"
                   title="可带宠物">
            <input type="checkbox" name="business_service" value="BIZ_SERVICE_FREE_WIFI"
                   th:checked="${#strings.contains(cpnServiceInfo.business_service==null?'':cpnServiceInfo.business_service,'BIZ_SERVICE_FREE_WIFI')}"
                   title="免费wifi">
        </div>
    </div>

    <div style="padding-left: 110px">
        <span style="color: red">注意:</span>
        <span >请根据商家自己的营业时间进行调整:</span>
    </div>
    <div class="layui-form-item" style="display: flex;align-items: center">
        <label class="layui-form-label">设置营业时间:</label>
        <div class="time layui-btn">设置</div>
    </div>



    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label"><span style="color: red">*</span>优惠券规则说明:</label>
        <div class="layui-input-block">
            <textarea name="description" lay-verify="required" placeholder="请输入优惠券规则说明" th:text="${cpnServiceInfo.description}"  class="layui-textarea"></textarea>
        </div>
    </div>


    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label"><span style="color: red">*</span>服务描述:</label>
        <div class="layui-input-block">
            <textarea name="serve_description" lay-verify="required" placeholder="请输入服务描述" th:text="${cpnServiceInfo.serve_description}"  class="layui-textarea"></textarea>
        </div>
    </div>

    <div class="layui-form-item" th:hidden="${cpnServiceInfo.status}==1" >
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="cpn_form_ok">提交</button>
        </div>
    </div>

</form>

<script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript" src="/js/cpn/cpn_mach_service_info.js"></script>

</body>
</html>